package com.xiaoxing.gongqiju.mvp.ui.adapter;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.gongqiju.R;
import com.xiaoxing.gongqiju.mvp.ui.entity.LiaoCheng_GongQiJu_RuKu;

import java.util.List;

import me.jessyan.armscomponent.commonsdk.core.RouterHub;
import me.jessyan.armscomponent.commonsdk.utils.Utils;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class LiaoCheng_GongQiJu_RuKuAdapter extends BaseQuickAdapter<LiaoCheng_GongQiJu_RuKu.DataBean, BaseViewHolder> {

    private Context mContext;

    public LiaoCheng_GongQiJu_RuKuAdapter(Context context, @Nullable List<LiaoCheng_GongQiJu_RuKu.DataBean> data) {
        super(R.layout.item_liao_cheng__gong_qi_ju__ru_ku, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, LiaoCheng_GongQiJu_RuKu.DataBean item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));
        helper.setText(R.id.tv_wu_liao_ming_cheng, "物料名称：" + item.getMaterialtoolname());
        helper.setText(R.id.tv_gong_ying_shang, "供应商：" + item.getSupplier());
        helper.setText(R.id.tv_wu_liao_zu_ming_cheng, "物料组名称：" + item.getMaterialGroupName());
        helper.setText(R.id.tv_wu_liao_dan_wei, "物料单位：" + item.getUnit());
        helper.setText(R.id.tv_wu_liao_da_lei_ming_cheng, "物料大类名称：" + item.getMaterialClassName());
        helper.setText(R.id.tv_chuang_jian_shi_jian, "创建时间：" + item.getCreatetime());
        helper.setOnClickListener(R.id.btn_ru_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putSerializable("item", item);
                Utils.navigation(mContext, RouterHub.GONGQIJU_LIAOCHENG_ACTIVITY_LIAO_CHENG_GONG_QI_JU_RU_KU_CAO_ZUO, bundle);
            }
        });
    }

}
